<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div>
        <p>333</p>
    </div>

    <script>

        // 替换   
        
        //   obj.innerHTML = '' ;

        //   replaceChild(new  , old) 

        var oDiv = document.querySelector('div') ;
        var oP = document.querySelector('p') ;
        var oH3 = document.createElement('h3') ;
        oH3.innerHTML = 333 ;
        oDiv.replaceChild(oH3 , oP) ;

    </script>
    
</body>
</html>